#region Usings

using System.IO;
using System.Xml;
using System.Collections.Generic;

#endregion

namespace Rail.Net.Core.WebServices
{
   #region Base entity class

    public partial class EntityBase<T>
    {
        private static System.Xml.Serialization.XmlSerializer serializer;

        private static System.Xml.Serialization.XmlSerializer Serializer
        {
            get
            {
                if ((serializer == null))
                {
                    serializer = new System.Xml.Serialization.XmlSerializer(typeof (T));
                }
                return serializer;
            }
        }

        #region Serialize/Deserialize

        /// <summary>
        ///   Serializes current EntityBase object into an XML document
        /// </summary>
        /// <returns>string XML value</returns>
        public virtual string Serialize(System.Text.Encoding encoding)
        {
            System.IO.StreamReader streamReader = null;
            System.IO.MemoryStream memoryStream = null;
            try
            {
                memoryStream = new System.IO.MemoryStream();
                var xmlWriterSettings = new System.Xml.XmlWriterSettings();
                xmlWriterSettings.Encoding = encoding;
                var xmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings);
                Serializer.Serialize(xmlWriter, this);
                memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
                streamReader = new System.IO.StreamReader(memoryStream);
                return streamReader.ReadToEnd();
            }
            finally
            {
                if ((streamReader != null))
                {
                    streamReader.Dispose();
                }
                if ((memoryStream != null))
                {
                    memoryStream.Dispose();
                }
            }
        }

        public virtual string Serialize()
        {
            return Serialize(System.Text.Encoding.Default);
        }

        /// <summary>
        ///   Deserializes workflow markup into an EntityBase object
        /// </summary>
        /// <param name = "xml">string workflow markup to deserialize</param>
        /// <param name = "obj">Output EntityBase object</param>
        /// <param name = "exception">output Exception value if deserialize failed</param>
        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        public static bool Deserialize(string xml, out T obj, out System.Exception exception)
        {
            exception = null;
            obj = default(T);
            try
            {
                obj = Deserialize(xml);
                return true;
            }
            catch (System.Exception ex)
            {
                exception = ex;
                return false;
            }
        }

        public static bool Deserialize(string xml, out T obj)
        {
            System.Exception exception = null;
            return Deserialize(xml, out obj, out exception);
        }

        public static T Deserialize(string xml)
        {
            System.IO.StringReader stringReader = null;
            try
            {
                stringReader = new System.IO.StringReader(xml);
                return ((T) (Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
            }
            finally
            {
                if ((stringReader != null))
                {
                    stringReader.Dispose();
                }
            }
        }

        /// <summary>
        ///   Serializes current EntityBase object into file
        /// </summary>
        /// <param name = "fileName">full path of outupt xml file</param>
        /// <param name = "exception">output Exception value if failed</param>
        /// <returns>true if can serialize and save into file; otherwise, false</returns>
        public virtual bool SaveToFile(string fileName, System.Text.Encoding encoding, out System.Exception exception)
        {
            exception = null;
            try
            {
                SaveToFile(fileName, encoding);
                return true;
            }
            catch (System.Exception e)
            {
                exception = e;
                return false;
            }
        }

        public virtual bool SaveToFile(string fileName, out System.Exception exception)
        {
            return SaveToFile(fileName, System.Text.Encoding.Default, out exception);
        }

        public virtual void SaveToFile(string fileName)
        {
            SaveToFile(fileName, System.Text.Encoding.Default);
        }

        public virtual void SaveToFile(string fileName, System.Text.Encoding encoding)
        {
            System.IO.StreamWriter streamWriter = null;
            try
            {
                var xmlString = Serialize(encoding);
                streamWriter = new System.IO.StreamWriter(fileName, false, System.Text.Encoding.Default);
                streamWriter.WriteLine(xmlString);
                streamWriter.Close();
            }
            finally
            {
                if ((streamWriter != null))
                {
                    streamWriter.Dispose();
                }
            }
        }

        /// <summary>
        ///   Deserializes xml markup from file into an EntityBase object
        /// </summary>
        /// <param name = "fileName">string xml file to load and deserialize</param>
        /// <param name = "obj">Output EntityBase object</param>
        /// <param name = "exception">output Exception value if deserialize failed</param>
        /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
        public static bool LoadFromFile(string fileName, System.Text.Encoding encoding, out T obj,
                                        out System.Exception exception)
        {
            exception = null;
            obj = default(T);
            try
            {
                obj = LoadFromFile(fileName, encoding);
                return true;
            }
            catch (System.Exception ex)
            {
                exception = ex;
                return false;
            }
        }

        public static bool LoadFromFile(string fileName, out T obj, out System.Exception exception)
        {
            return LoadFromFile(fileName, System.Text.Encoding.Default, out obj, out exception);
        }

        public static bool LoadFromFile(string fileName, out T obj)
        {
            System.Exception exception = null;
            return LoadFromFile(fileName, out obj, out exception);
        }

        public static T LoadFromFile(string fileName)
        {
            return LoadFromFile(fileName, System.Text.Encoding.Default);
        }

        public static T LoadFromFile(string fileName, System.Text.Encoding encoding)
        {
            System.IO.FileStream file = null;
            System.IO.StreamReader sr = null;
            try
            {
                file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
                sr = new System.IO.StreamReader(file, encoding);
                var xmlString = sr.ReadToEnd();
                sr.Close();
                file.Close();
                return Deserialize(xmlString);
            }
            finally
            {
                if ((file != null))
                {
                    file.Dispose();
                }
                if ((sr != null))
                {
                    sr.Dispose();
                }
            }
        }

        #endregion
    }

    #endregion

    /// <summary>
    ///   The LocValRes takes matched locations, returned by Hafas as a response to a LocValReq. In case of Address, Poi or Station, these Locations can directly be taken as part of a subsequent connectionrequest (ConReq). If the returned element is a ReqLoc, this location may not be inserted into a ConReq, but must be refined. This means that another LocValReq step must be performed, if the user selects this location. The ReqLoc therefore must be inserted as is into this subsequent LocValReq. (The ReqLoc will have filled the attribute refine instead of match, telling Hafas to perform a refinement step instead of the initial request.) A single LocValRes can can contain any type of Location in an arbitrary order.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
    public partial class LocValRes : EntityBase<LocValRes>
    {
        private List<Err> errField;

        private LocValResFlag flagField;
        private List<StationType> itemsField;

        [System.Xml.Serialization.XmlElementAttribute("Err", Order = 0)]
        public virtual List<Err> Err
        {
            get
            {
                if ((this.errField == null))
                {
                    this.errField = new List<Err>();
                }
                return this.errField;
            }
            set { this.errField = value; }
        }

        [System.Xml.Serialization.XmlElementAttribute("Station", Order = 1)]
        public virtual List<StationType> Items
        {
            get
            {
                if ((this.itemsField == null))
                {
                    this.itemsField = new List<StationType>();
                }
                return this.itemsField;
            }
            set { this.itemsField = value; }
        }

        [System.Xml.Serialization.XmlAttributeAttribute()]
        public virtual LocValResFlag flag
        {
            get { return this.flagField; }
            set { this.flagField = value; }
        }
    }

    /// <summary>
    ///   If an error occurs, the element Err indicates the type of the error and a descriptive text. This text is meant to be used for logging purposes or other internal use. Normally this message should not be presented to the user.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
    public partial class Err : EntityBase<Err>
    {
        private string codeField;

        private ErrLevel levelField;
        private string textField;

        public Err()
        {
            this.levelField = ErrLevel.E;
        }

        [System.Xml.Serialization.XmlAttributeAttribute(DataType = "token")]
        public virtual string code
        {
            get { return this.codeField; }
            set { this.codeField = value; }
        }

        [System.Xml.Serialization.XmlAttributeAttribute()]
        public virtual string text
        {
            get { return this.textField; }
            set { this.textField = value; }
        }

        [System.Xml.Serialization.XmlAttributeAttribute()]
        [System.ComponentModel.DefaultValueAttribute(ErrLevel.E)]
        public virtual ErrLevel level
        {
            get { return this.levelField; }
            set { this.levelField = value; }
        }
    }

    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    public enum ErrLevel
    {
        /// <remarks />
        M,

        /// <remarks />
        W,

        /// <remarks />
        E,

        /// <remarks />
        F,
    }

    [System.Xml.Serialization.XmlIncludeAttribute(typeof (StationType))]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlRootAttribute("Coord", Namespace = "", IsNullable = false)]
    public partial class LocationType : EntityBase<LocationType>
    {
        private string nameField;
        private LocationTypeType typeField;

        private string xField;

        private string yField;

        private string zField;

        public LocationType()
        {
            this.typeField = LocationTypeType.WGS84;
        }

        [System.Xml.Serialization.XmlAttributeAttribute()]
        public virtual string name
        {
            get { return this.nameField; }
            set { this.nameField = value; }
        }

        [System.Xml.Serialization.XmlAttributeAttribute(DataType = "integer")]
        public virtual string x
        {
            get { return this.xField; }
            set { this.xField = value; }
        }

        [System.Xml.Serialization.XmlAttributeAttribute(DataType = "integer")]
        public virtual string y
        {
            get { return this.yField; }
            set { this.yField = value; }
        }

        [System.Xml.Serialization.XmlAttributeAttribute(DataType = "integer")]
        public virtual string z
        {
            get { return this.zField; }
            set { this.zField = value; }
        }

        [System.Xml.Serialization.XmlAttributeAttribute()]
        [System.ComponentModel.DefaultValueAttribute(LocationTypeType.WGS84)]
        public virtual LocationTypeType type
        {
            get { return this.typeField; }
            set { this.typeField = value; }
        }
    }

    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    public enum LocationTypeType
    {
        /// <remarks />
        HAFAS_GEO,

        /// <remarks />
        HAFAS_HANNOVER,

        /// <remarks />
        WGS84,

        /// <remarks />
        [System.Xml.Serialization.XmlEnumAttribute("CH-COORD")] CHCOORD,
    }

    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlRootAttribute("Station", Namespace = "", IsNullable = false)]
    public partial class StationType : LocationType
    {
        private string externalIdField;

        private string externalStationNrField;
        private string uicCodeField;

        [System.Xml.Serialization.XmlAttributeAttribute()]
        public virtual string externalId
        {
            get { return this.externalIdField; }
            set { this.externalIdField = value; }
        }

        [System.Xml.Serialization.XmlAttributeAttribute(DataType = "integer")]
        public virtual string uicCode
        {
            get { return this.uicCodeField; }
            set { this.uicCodeField = value; }
        }

        [System.Xml.Serialization.XmlAttributeAttribute()]
        public virtual string externalStationNr
        {
            get { return this.externalStationNrField; }
            set { this.externalStationNrField = value; }
        }
    }

    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    public enum LocValResFlag
    {
        /// <remarks />
        META,

        /// <remarks />
        FINAL,

        /// <remarks />
        MIXED,
    }

    /// <summary>
    ///   The element Prod contains the product choice and related things. The element prod is placed within the Start ans the Via elements. The product choice defined in Prod is valid for the section of the Journey, that starts at the current location and ends at the next Via or Dest element.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
    public partial class Prod : EntityBase<Prod>
    {
        private ProdBike bikeField;
        private ProdCouchette couchetteField;
        private ProdDirect directField;
        private string prodField;

        private ProdSleeper sleeperField;

        public Prod()
        {
            this.directField = ProdDirect.Item0;
            this.sleeperField = ProdSleeper.Item0;
            this.couchetteField = ProdCouchette.Item0;
            this.bikeField = ProdBike.Item0;
        }

        [System.Xml.Serialization.XmlAttributeAttribute()]
        public virtual string prod
        {
            get { return this.prodField; }
            set { this.prodField = value; }
        }

        [System.Xml.Serialization.XmlAttributeAttribute()]
        [System.ComponentModel.DefaultValueAttribute(ProdDirect.Item0)]
        public virtual ProdDirect direct
        {
            get { return this.directField; }
            set { this.directField = value; }
        }

        [System.Xml.Serialization.XmlAttributeAttribute()]
        [System.ComponentModel.DefaultValueAttribute(ProdSleeper.Item0)]
        public virtual ProdSleeper sleeper
        {
            get { return this.sleeperField; }
            set { this.sleeperField = value; }
        }

        [System.Xml.Serialization.XmlAttributeAttribute()]
        [System.ComponentModel.DefaultValueAttribute(ProdCouchette.Item0)]
        public virtual ProdCouchette couchette
        {
            get { return this.couchetteField; }
            set { this.couchetteField = value; }
        }

        [System.Xml.Serialization.XmlAttributeAttribute()]
        [System.ComponentModel.DefaultValueAttribute(ProdBike.Item0)]
        public virtual ProdBike bike
        {
            get { return this.bikeField; }
            set { this.bikeField = value; }
        }
    }

    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    public enum ProdDirect
    {
        /// <remarks />
        [System.Xml.Serialization.XmlEnumAttribute("0")] Item0,

        /// <remarks />
        [System.Xml.Serialization.XmlEnumAttribute("1")] Item1,
    }

    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    public enum ProdSleeper
    {
        /// <remarks />
        [System.Xml.Serialization.XmlEnumAttribute("0")] Item0,

        /// <remarks />
        [System.Xml.Serialization.XmlEnumAttribute("1")] Item1,
    }

    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    public enum ProdCouchette
    {
        /// <remarks />
        [System.Xml.Serialization.XmlEnumAttribute("0")] Item0,

        /// <remarks />
        [System.Xml.Serialization.XmlEnumAttribute("1")] Item1,
    }

    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    public enum ProdBike
    {
        /// <remarks />
        [System.Xml.Serialization.XmlEnumAttribute("0")] Item0,

        /// <remarks />
        [System.Xml.Serialization.XmlEnumAttribute("1")] Item1,
    }

    /// <summary>
    ///   ResC is the container for any type of results, calculated by the Hafas server.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
    public partial class ResC : EntityBase<ResC>
    {
        private List<Err> errField;

        private List<object> itemsField;

        private ResCLang langField;
        private string prodField;
        private string verField;

        public ResC()
        {
            this.verField = "1.1";
        }

        [System.Xml.Serialization.XmlElementAttribute("Err", Order = 0)]
        public virtual List<Err> Err
        {
            get
            {
                if ((this.errField == null))
                {
                    this.errField = new List<Err>();
                }
                return this.errField;
            }
            set { this.errField = value; }
        }

        [System.Xml.Serialization.XmlElementAttribute("ConRes", typeof (ConRes), Order = 1)]
        [System.Xml.Serialization.XmlElementAttribute("LocValRes", typeof (LocValRes), Order = 1)]
        public virtual List<object> Items
        {
            get
            {
                if ((this.itemsField == null))
                {
                    this.itemsField = new List<object>();
                }
                return this.itemsField;
            }
            set { this.itemsField = value; }
        }

        [System.Xml.Serialization.XmlAttributeAttribute()]
        public virtual string ver
        {
            get { return this.verField; }
            set { this.verField = value; }
        }

        [System.Xml.Serialization.XmlAttributeAttribute()]
        public virtual string prod
        {
            get { return this.prodField; }
            set { this.prodField = value; }
        }

        [System.Xml.Serialization.XmlAttributeAttribute()]
        public virtual ResCLang lang
        {
            get { return this.langField; }
            set { this.langField = value; }
        }
    }

    /// <summary>
    ///   A ConRes is the connection result. This Type of result is returned as a resonse to a connection request (ConReq) or a connection scroll request (ConScrReq).
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
    public partial class ConRes : EntityBase<ConRes>
    {
        private List<object> conResCtxtField;

        private ConnectionList connectionListField;

        private ConResDir dirField;
        private List<Err> errField;

        [System.Xml.Serialization.XmlElementAttribute("Err", Order = 0)]
        public virtual List<Err> Err
        {
            get
            {
                if ((this.errField == null))
                {
                    this.errField = new List<Err>();
                }
                return this.errField;
            }
            set { this.errField = value; }
        }

        [System.Xml.Serialization.XmlElementAttribute("ConResCtxt", Order = 1)]
        public virtual List<object> ConResCtxt
        {
            get
            {
                if ((this.conResCtxtField == null))
                {
                    this.conResCtxtField = new List<object>();
                }
                return this.conResCtxtField;
            }
            set { this.conResCtxtField = value; }
        }

        [System.Xml.Serialization.XmlElementAttribute(Order = 2)]
        public virtual ConnectionList ConnectionList
        {
            get
            {
                if ((this.connectionListField == null))
                {
                    this.connectionListField = new ConnectionList();
                }
                return this.connectionListField;
            }
            set { this.connectionListField = value; }
        }

        [System.Xml.Serialization.XmlAttributeAttribute()]
        public virtual ConResDir dir
        {
            get { return this.dirField; }
            set { this.dirField = value; }
        }
    }

    /// <summary>
    ///   The ConnectionList element is the container for all connections calculated by the Hafas server.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
    public partial class ConnectionList : EntityBase<ConnectionList>
    {
        private List<Connection> connectionField;
        private Err errField;

        [System.Xml.Serialization.XmlElementAttribute(Order = 0)]
        public virtual Err Err
        {
            get
            {
                if ((this.errField == null))
                {
                    this.errField = new Err();
                }
                return this.errField;
            }
            set { this.errField = value; }
        }

        [System.Xml.Serialization.XmlElementAttribute("Connection", Order = 1)]
        public virtual List<Connection> Connection
        {
            get
            {
                if ((this.connectionField == null))
                {
                    this.connectionField = new List<Connection>();
                }
                return this.connectionField;
            }
            set { this.connectionField = value; }
        }
    }

    /// <summary>
    ///   The element Connection is a container for all the data belonging to one connection.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
    public partial class Connection : EntityBase<Connection>
    {
        private List<Comment> commentListField;
        private List<ConSection> conSectionListField;

        private string idField;
        private Overview overviewField;

        [System.Xml.Serialization.XmlElementAttribute(Order = 0)]
        public virtual Overview Overview
        {
            get
            {
                if ((this.overviewField == null))
                {
                    this.overviewField = new Overview();
                }
                return this.overviewField;
            }
            set { this.overviewField = value; }
        }

        [System.Xml.Serialization.XmlArrayAttribute(Order = 1)]
        [System.Xml.Serialization.XmlArrayItemAttribute("ConSection", IsNullable = false)]
        public virtual List<ConSection> ConSectionList
        {
            get
            {
                if ((this.conSectionListField == null))
                {
                    this.conSectionListField = new List<ConSection>();
                }
                return this.conSectionListField;
            }
            set { this.conSectionListField = value; }
        }

        [System.Xml.Serialization.XmlArrayAttribute(Order = 2)]
        [System.Xml.Serialization.XmlArrayItemAttribute("Comment", IsNullable = false)]
        public virtual List<Comment> CommentList
        {
            get
            {
                if ((this.commentListField == null))
                {
                    this.commentListField = new List<Comment>();
                }
                return this.commentListField;
            }
            set { this.commentListField = value; }
        }

        [System.Xml.Serialization.XmlAttributeAttribute(DataType = "ID")]
        public virtual string id
        {
            get { return this.idField; }
            set { this.idField = value; }
        }
    }

    /// <summary>
    ///   The element overview takes all relevant elements to display an overview of the connection. This includes Date (the base date), Departure, Arrival, Transfers, Duration, ServiceDays and ContextURL.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
    public partial class Overview : EntityBase<Overview>
    {
        private Arrival arrivalField;
        private ContextURL contextURLField;
        private string dateField;

        private Departure departureField;

        private TimeType durationField;

        private List<Product> productsField;
        private ServiceDays serviceDaysField;
        private string transfersField;

        [System.Xml.Serialization.XmlElementAttribute(Order = 0)]
        public virtual string Date
        {
            get { return this.dateField; }
            set { this.dateField = value; }
        }

        [System.Xml.Serialization.XmlElementAttribute(Order = 1)]
        public virtual Departure Departure
        {
            get
            {
                if ((this.departureField == null))
                {
                    this.departureField = new Departure();
                }
                return this.departureField;
            }
            set { this.departureField = value; }
        }

        [System.Xml.Serialization.XmlElementAttribute(Order = 2)]
        public virtual Arrival Arrival
        {
            get
            {
                if ((this.arrivalField == null))
                {
                    this.arrivalField = new Arrival();
                }
                return this.arrivalField;
            }
            set { this.arrivalField = value; }
        }

        [System.Xml.Serialization.XmlElementAttribute(Order = 3)]
        public virtual string Transfers
        {
            get { return this.transfersField; }
            set { this.transfersField = value; }
        }

        [System.Xml.Serialization.XmlElementAttribute(Order = 4)]
        public virtual TimeType Duration
        {
            get
            {
                if ((this.durationField == null))
                {
                    this.durationField = new TimeType();
                }
                return this.durationField;
            }
            set { this.durationField = value; }
        }

        [System.Xml.Serialization.XmlElementAttribute(Order = 5)]
        public virtual ServiceDays ServiceDays
        {
            get
            {
                if ((this.serviceDaysField == null))
                {
                    this.serviceDaysField = new ServiceDays();
                }
                return this.serviceDaysField;
            }
            set { this.serviceDaysField = value; }
        }

        [System.Xml.Serialization.XmlArrayAttribute(Order = 6)]
        [System.Xml.Serialization.XmlArrayItemAttribute("Product", IsNullable = false)]
        public virtual List<Product> Products
        {
            get
            {
                if ((this.productsField == null))
                {
                    this.productsField = new List<Product>();
                }
                return this.productsField;
            }
            set { this.productsField = value; }
        }

        [System.Xml.Serialization.XmlElementAttribute(Order = 7)]
        public virtual ContextURL ContextURL
        {
            get
            {
                if ((this.contextURLField == null))
                {
                    this.contextURLField = new ContextURL();
                }
                return this.contextURLField;
            }
            set { this.contextURLField = value; }
        }
    }

    /// <summary>
    ///   The departure location of a ConSection
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
    public partial class Departure : EntityBase<Departure>
    {
        private BasicStop basicStopField;

        [System.Xml.Serialization.XmlElementAttribute(Order = 0)]
        public virtual BasicStop BasicStop
        {
            get
            {
                if ((this.basicStopField == null))
                {
                    this.basicStopField = new BasicStop();
                }
                return this.basicStopField;
            }
            set { this.basicStopField = value; }
        }
    }

    /// <summary>
    ///   The element BasicStop represents a Location, as a part of the current ConSection. It contains a Location (Station, Address, Poi) together with the arrival and departure times at this location, as well as some other information like platforms.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
    public partial class BasicStop : EntityBase<BasicStop>
    {
        private ArrDepType arrField;

        private ArrDepType depField;

        private string indexField;
        private StationType itemField;
        private List<BasicStopStAttrListStAttr> stAttrListField;
        private BasicStopType typeField;

        public BasicStop()
        {
            this.typeField = BasicStopType.NORMAL;
        }

        [System.Xml.Serialization.XmlArrayAttribute(Order = 0)]
        [System.Xml.Serialization.XmlArrayItemAttribute("StAttr", typeof (BasicStopStAttrListStAttr), IsNullable = false
            )]
        public virtual List<BasicStopStAttrListStAttr> StAttrList
        {
            get
            {
                if ((this.stAttrListField == null))
                {
                    this.stAttrListField = new List<BasicStopStAttrListStAttr>();
                }
                return this.stAttrListField;
            }
            set { this.stAttrListField = value; }
        }

        [System.Xml.Serialization.XmlElementAttribute("Station", Order = 1)]
        public virtual StationType Item
        {
            get
            {
                if ((this.itemField == null))
                {
                    this.itemField = new StationType();
                }
                return this.itemField;
            }
            set { this.itemField = value; }
        }

        [System.Xml.Serialization.XmlElementAttribute(Order = 2)]
        public virtual ArrDepType Arr
        {
            get
            {
                if ((this.arrField == null))
                {
                    this.arrField = new ArrDepType();
                }
                return this.arrField;
            }
            set { this.arrField = value; }
        }

        [System.Xml.Serialization.XmlElementAttribute(Order = 3)]
        public virtual ArrDepType Dep
        {
            get
            {
                if ((this.depField == null))
                {
                    this.depField = new ArrDepType();
                }
                return this.depField;
            }
            set { this.depField = value; }
        }

        [System.Xml.Serialization.XmlAttributeAttribute()]
        [System.ComponentModel.DefaultValueAttribute(BasicStopType.NORMAL)]
        public virtual BasicStopType type
        {
            get { return this.typeField; }
            set { this.typeField = value; }
        }

        [System.Xml.Serialization.XmlAttributeAttribute()]
        public virtual string index
        {
            get { return this.indexField; }
            set { this.indexField = value; }
        }
    }

    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    public partial class BasicStopStAttrListStAttr : EntityBase<BasicStopStAttrListStAttr>
    {
        private string codeField;

        private int priorityField;

        private bool priorityFieldSpecified;
        private string textField;

        private string typeField;

        [System.Xml.Serialization.XmlAttributeAttribute()]
        public virtual string code
        {
            get { return this.codeField; }
            set { this.codeField = value; }
        }

        [System.Xml.Serialization.XmlAttributeAttribute()]
        public virtual string text
        {
            get { return this.textField; }
            set { this.textField = value; }
        }

        [System.Xml.Serialization.XmlAttributeAttribute()]
        public virtual int priority
        {
            get { return this.priorityField; }
            set { this.priorityField = value; }
        }

        [System.Xml.Serialization.XmlIgnoreAttribute()]
        public virtual bool prioritySpecified
        {
            get { return this.priorityFieldSpecified; }
            set { this.priorityFieldSpecified = value; }
        }

        [System.Xml.Serialization.XmlAttributeAttribute()]
        public virtual string type
        {
            get { return this.typeField; }
            set { this.typeField = value; }
        }
    }

    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlRootAttribute("Dep", Namespace = "", IsNullable = false)]
    public partial class ArrDepType : TimeType
    {
        private ArrDepTypeGetIn getInField;
        private ArrDepTypeGetOut getOutField;
        private List<Text> platformField;

        public ArrDepType()
        {
            this.getOutField = ArrDepTypeGetOut.YES;
            this.getInField = ArrDepTypeGetIn.YES;
        }

        [System.Xml.Serialization.XmlArrayAttribute(Order = 0)]
        [System.Xml.Serialization.XmlArrayItemAttribute("Text", IsNullable = false)]
        public virtual List<Text> Platform
        {
            get
            {
                if ((this.platformField == null))
                {
                    this.platformField = new List<Text>();
                }
                return this.platformField;
            }
            set { this.platformField = value; }
        }

        [System.Xml.Serialization.XmlAttributeAttribute()]
        [System.ComponentModel.DefaultValueAttribute(ArrDepTypeGetOut.YES)]
        public virtual ArrDepTypeGetOut getOut
        {
            get { return this.getOutField; }
            set { this.getOutField = value; }
        }

        [System.Xml.Serialization.XmlAttributeAttribute()]
        [System.ComponentModel.DefaultValueAttribute(ArrDepTypeGetIn.YES)]
        public virtual ArrDepTypeGetIn getIn
        {
            get { return this.getInField; }
            set { this.getInField = value; }
        }
    }

    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
    public partial class Text : EntityBase<Text>
    {
        private TextLang langField;

        private bool langFieldSpecified;

        private List<string> text1Field;

        [System.Xml.Serialization.XmlAttributeAttribute()]
        public virtual TextLang lang
        {
            get { return this.langField; }
            set { this.langField = value; }
        }

        [System.Xml.Serialization.XmlIgnoreAttribute()]
        public virtual bool langSpecified
        {
            get { return this.langFieldSpecified; }
            set { this.langFieldSpecified = value; }
        }

        [System.Xml.Serialization.XmlTextAttribute()]
        public virtual List<string> Text1
        {
            get
            {
                if ((this.text1Field == null))
                {
                    this.text1Field = new List<string>();
                }
                return this.text1Field;
            }
            set { this.text1Field = value; }
        }
    }

    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    public enum TextLang
    {
        /// <remarks />
        DE,

        /// <remarks />
        DK,

        /// <remarks />
        EN,

        /// <remarks />
        FR,

        /// <remarks />
        PL,

        /// <remarks />
        IT,

        /// <remarks />
        MACRO,
    }

    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    public enum ArrDepTypeGetOut
    {
        /// <remarks />
        YES,

        /// <remarks />
        NO,
    }

    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    public enum ArrDepTypeGetIn
    {
        /// <remarks />
        YES,

        /// <remarks />
        NO,
    }

    [System.Xml.Serialization.XmlIncludeAttribute(typeof (ArrDepType))]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlRootAttribute("Duration", Namespace = "", IsNullable = false)]
    public partial class TimeType : EntityBase<TimeType>
    {
        private Time timeField;

        [System.Xml.Serialization.XmlElementAttribute(Order = 0)]
        public virtual Time Time
        {
            get
            {
                if ((this.timeField == null))
                {
                    this.timeField = new Time();
                }
                return this.timeField;
            }
            set { this.timeField = value; }
        }
    }

    /// <summary>
    ///   The format of the Time element is [dd:]hh:mm. dd represents a day offset. All offsets are relative to the base date of the connection. For example a time 01:12:30 means 12:30 at the first day following the day specified as the base date in the Date element in the Overview section of the connection.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
    public partial class Time : EntityBase<Time>
    {
        private string delayField;

        private List<string> textField;

        [System.Xml.Serialization.XmlAttributeAttribute()]
        public virtual string delay
        {
            get { return this.delayField; }
            set { this.delayField = value; }
        }

        [System.Xml.Serialization.XmlTextAttribute()]
        public virtual List<string> Text
        {
            get
            {
                if ((this.textField == null))
                {
                    this.textField = new List<string>();
                }
                return this.textField;
            }
            set { this.textField = value; }
        }
    }

    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    public enum BasicStopType
    {
        /// <remarks />
        NORMAL,

        /// <remarks />
        VIRTUAL,
    }

    /// <summary>
    ///   The arrival location of a ConSection
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
    public partial class Arrival : EntityBase<Arrival>
    {
        private BasicStop basicStopField;

        [System.Xml.Serialization.XmlElementAttribute(Order = 0)]
        public virtual BasicStop BasicStop
        {
            get
            {
                if ((this.basicStopField == null))
                {
                    this.basicStopField = new BasicStop();
                }
                return this.basicStopField;
            }
            set { this.basicStopField = value; }
        }
    }

    /// <summary>
    ///   The element ServiceDays specifies the days, the current connection is served. There are two representations of the servicedays. The ServiceBits take a bitfield of the servicedays. In addition there is a textual description of the servicedays, separated into regular servicedays (Mo-Fr) and irregular servicedays (not 24., 25, 26. Dez...) The textual description is given in a macro language, where all language specific parts are substituted with macros of the form $(vt<xy>)
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
    public partial class ServiceDays : EntityBase<ServiceDays>
    {
        private List<Text> irregularServiceTextField;
        private List<Text> regularServiceTextField;
        private string serviceBitsField;

        [System.Xml.Serialization.XmlElementAttribute(Order = 0)]
        public virtual string ServiceBits
        {
            get { return this.serviceBitsField; }
            set { this.serviceBitsField = value; }
        }

        [System.Xml.Serialization.XmlArrayAttribute(Order = 1)]
        [System.Xml.Serialization.XmlArrayItemAttribute("Text", IsNullable = false)]
        public virtual List<Text> RegularServiceText
        {
            get
            {
                if ((this.regularServiceTextField == null))
                {
                    this.regularServiceTextField = new List<Text>();
                }
                return this.regularServiceTextField;
            }
            set { this.regularServiceTextField = value; }
        }

        [System.Xml.Serialization.XmlArrayAttribute(Order = 2)]
        [System.Xml.Serialization.XmlArrayItemAttribute("Text", IsNullable = false)]
        public virtual List<Text> IrregularServiceText
        {
            get
            {
                if ((this.irregularServiceTextField == null))
                {
                    this.irregularServiceTextField = new List<Text>();
                }
                return this.irregularServiceTextField;
            }
            set { this.irregularServiceTextField = value; }
        }
    }

    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
    public partial class Product : EntityBase<Product>
    {
        private string catField;

        [System.Xml.Serialization.XmlAttributeAttribute()]
        public virtual string cat
        {
            get { return this.catField; }
            set { this.catField = value; }
        }
    }

    /// <summary>
    ///   The element ContextURL takes an URL that generates a more detailed view of the connection specified in the overview. If you need this element please contact  us. By default, this element will not be available.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
    public partial class ContextURL : EntityBase<ContextURL>
    {
        private string urlField;

        [System.Xml.Serialization.XmlAttributeAttribute(DataType = "anyURI")]
        public virtual string url
        {
            get { return this.urlField; }
            set { this.urlField = value; }
        }
    }

    /// <summary>
    ///   A ConSection consists of a Departure an Arrival and an element Journey, Walk, Transfer or GisRoute, giving more informations about the current ConSection.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
    public partial class ConSection : EntityBase<ConSection>
    {
        private Arrival arrivalField;
        private Departure departureField;

        private object itemField;

        [System.Xml.Serialization.XmlElementAttribute(Order = 0)]
        public virtual Departure Departure
        {
            get
            {
                if ((this.departureField == null))
                {
                    this.departureField = new Departure();
                }
                return this.departureField;
            }
            set { this.departureField = value; }
        }

        [System.Xml.Serialization.XmlElementAttribute("Journey", typeof (Journey), Order = 1)]
        [System.Xml.Serialization.XmlElementAttribute("Transfer", typeof (Transfer), Order = 1)]
        [System.Xml.Serialization.XmlElementAttribute("Walk", typeof (Walk), Order = 1)]
        public virtual object Item
        {
            get { return this.itemField; }
            set { this.itemField = value; }
        }

        [System.Xml.Serialization.XmlElementAttribute(Order = 2)]
        public virtual Arrival Arrival
        {
            get
            {
                if ((this.arrivalField == null))
                {
                    this.arrivalField = new Arrival();
                }
                return this.arrivalField;
            }
            set { this.arrivalField = value; }
        }
    }

    /// <summary>
    ///   The element Journey contains the List with the JourneyAttributes valid for the current ConSection, as well as (optionally) a PassList containing extended Information about the passed stations.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
    public partial class Journey : EntityBase<Journey>, IConnection
    {
        private List<JourneyJHandle> jHandleField;

        private List<JourneyAttribute> journeyAttributeListField;

        private List<BasicStop> passListField;

        [System.Xml.Serialization.XmlElementAttribute("JHandle", Order = 0)]
        public virtual List<JourneyJHandle> JHandle
        {
            get
            {
                if ((this.jHandleField == null))
                {
                    this.jHandleField = new List<JourneyJHandle>();
                }
                return this.jHandleField;
            }
            set { this.jHandleField = value; }
        }

        [System.Xml.Serialization.XmlArrayAttribute(Order = 2)]
        [System.Xml.Serialization.XmlArrayItemAttribute("BasicStop", IsNullable = false)]
        public virtual List<BasicStop> PassList
        {
            get
            {
                if ((this.passListField == null))
                {
                    this.passListField = new List<BasicStop>();
                }
                return this.passListField;
            }
            set { this.passListField = value; }
        }

        #region IConnection Members

        [System.Xml.Serialization.XmlArrayAttribute(Order = 1)]
        [System.Xml.Serialization.XmlArrayItemAttribute("JourneyAttribute", IsNullable = false)]
        public virtual List<JourneyAttribute> JourneyAttributeList
        {
            get
            {
                if ((this.journeyAttributeListField == null))
                {
                    this.journeyAttributeListField = new List<JourneyAttribute>();
                }
                return this.journeyAttributeListField;
            }
            set { this.journeyAttributeListField = value; }
        }

        #endregion
    }

    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    public partial class JourneyJHandle : EntityBase<JourneyJHandle>
    {
        private int cycleField;

        private bool cycleFieldSpecified;

        private int puicField;

        private bool puicFieldSpecified;
        private int tNrField;

        private bool tNrFieldSpecified;

        [System.Xml.Serialization.XmlAttributeAttribute()]
        public virtual int tNr
        {
            get { return this.tNrField; }
            set { this.tNrField = value; }
        }

        [System.Xml.Serialization.XmlIgnoreAttribute()]
        public virtual bool tNrSpecified
        {
            get { return this.tNrFieldSpecified; }
            set { this.tNrFieldSpecified = value; }
        }

        [System.Xml.Serialization.XmlAttributeAttribute()]
        public virtual int cycle
        {
            get { return this.cycleField; }
            set { this.cycleField = value; }
        }

        [System.Xml.Serialization.XmlIgnoreAttribute()]
        public virtual bool cycleSpecified
        {
            get { return this.cycleFieldSpecified; }
            set { this.cycleFieldSpecified = value; }
        }

        [System.Xml.Serialization.XmlAttributeAttribute()]
        public virtual int puic
        {
            get { return this.puicField; }
            set { this.puicField = value; }
        }

        [System.Xml.Serialization.XmlIgnoreAttribute()]
        public virtual bool puicSpecified
        {
            get { return this.puicFieldSpecified; }
            set { this.puicFieldSpecified = value; }
        }
    }

    /// <summary>
    ///   A JourneyAttribute contains an element Attribute as well as validity informations for this attribute. An attribute must not be valid for the whole ConSection and it must not be valid at all the ServiceDays of the connection. So the JourneyAttribute can take two attributes from and to, specifying an index into the PassList. Every BasicStop within a PassList has an attribute index. The Attribute is valid from the BasicStop with the index matching the index given in the attribute from, to the BasicStop with the index matching the index given in the attribute to. The element SeviceDays specifies the days were the Attribute is valid. if the element ServiceDays is not given, the attribute is valid at all the servicedays of the connection. The restriction of the ServiceDays of an Attribute is not used at the moment, but may be activated in later versions of this interface.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
    public partial class JourneyAttribute : EntityBase<JourneyAttribute>
    {
        private Attribute attributeField;

        private string fromField;
        private ServiceDays serviceDaysField;

        private string toField;

        [System.Xml.Serialization.XmlElementAttribute(Order = 0)]
        public virtual Attribute Attribute
        {
            get
            {
                if ((this.attributeField == null))
                {
                    this.attributeField = new Attribute();
                }
                return this.attributeField;
            }
            set { this.attributeField = value; }
        }

        [System.Xml.Serialization.XmlElementAttribute(Order = 1)]
        public virtual ServiceDays ServiceDays
        {
            get
            {
                if ((this.serviceDaysField == null))
                {
                    this.serviceDaysField = new ServiceDays();
                }
                return this.serviceDaysField;
            }
            set { this.serviceDaysField = value; }
        }

        [System.Xml.Serialization.XmlAttributeAttribute(DataType = "integer")]
        public virtual string from
        {
            get { return this.fromField; }
            set { this.fromField = value; }
        }

        [System.Xml.Serialization.XmlAttributeAttribute(DataType = "integer")]
        public virtual string to
        {
            get { return this.toField; }
            set { this.toField = value; }
        }
    }

    /// <summary>
    ///   Attributes describe the characteristics of a ConSection, such as the name of the means of transport, the category of the means of transport, general attributes like Bord Restaurant, Reservation required and other characteristics. For a detailed description of the different attributes see the attribute type. Some types of attributes can have different attribute variants (NORMAL, SHORT and LONG), containing different Levels of information.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
    public partial class Attribute : EntityBase<Attribute>
    {
        private List<AttributeVariant> attributeVariantField;
        private string codeField;

        private string priorityField;

        private AttributeType typeField;

        public Attribute()
        {
            this.typeField = AttributeType.NORMAL;
        }

        [System.Xml.Serialization.XmlElementAttribute("AttributeVariant", Order = 0)]
        public virtual List<AttributeVariant> AttributeVariant
        {
            get
            {
                if ((this.attributeVariantField == null))
                {
                    this.attributeVariantField = new List<AttributeVariant>();
                }
                return this.attributeVariantField;
            }
            set { this.attributeVariantField = value; }
        }

        [System.Xml.Serialization.XmlAttributeAttribute(DataType = "integer")]
        public virtual string priority
        {
            get { return this.priorityField; }
            set { this.priorityField = value; }
        }

        [System.Xml.Serialization.XmlAttributeAttribute()]
        [System.ComponentModel.DefaultValueAttribute(AttributeType.NORMAL)]
        public virtual AttributeType type
        {
            get { return this.typeField; }
            set { this.typeField = value; }
        }

        [System.Xml.Serialization.XmlAttributeAttribute(DataType = "token")]
        public virtual string code
        {
            get { return this.codeField; }
            set { this.codeField = value; }
        }
    }

    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
    public partial class AttributeVariant : EntityBase<AttributeVariant>
    {
        private List<Text> textField;

        private AttributeVariantType typeField;

        public AttributeVariant()
        {
            this.typeField = AttributeVariantType.NORMAL;
        }

        [System.Xml.Serialization.XmlElementAttribute("Text", Order = 0)]
        public virtual List<Text> Text
        {
            get
            {
                if ((this.textField == null))
                {
                    this.textField = new List<Text>();
                }
                return this.textField;
            }
            set { this.textField = value; }
        }

        [System.Xml.Serialization.XmlAttributeAttribute()]
        [System.ComponentModel.DefaultValueAttribute(AttributeVariantType.NORMAL)]
        public virtual AttributeVariantType type
        {
            get { return this.typeField; }
            set { this.typeField = value; }
        }
    }

    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    public enum AttributeVariantType
    {
        /// <remarks />
        SHORT,

        /// <remarks />
        NORMAL,

        /// <remarks />
        LONG,
    }

    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    public enum AttributeType
    {
        /// <remarks />
        NORMAL,

        /// <remarks />
        DIRECTION,

        /// <remarks />
        CATEGORY,

        /// <remarks />
        INTERNALCATEGORY,

        /// <remarks />
        OPERATOR,

        /// <remarks />
        NAME,

        /// <remarks />
        NUMBER,
    }

    /// <summary>
    ///   A Transfer is an unrouted transition with a duration of more than 15 minutes.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
    public partial class Transfer : EntityBase<Transfer>, IConnection
    {
        private TimeType durationField;

        private List<JourneyAttribute> journeyAttributeListField;

        [System.Xml.Serialization.XmlElementAttribute(Order = 0)]
        public virtual TimeType Duration
        {
            get
            {
                if ((this.durationField == null))
                {
                    this.durationField = new TimeType();
                }
                return this.durationField;
            }
            set { this.durationField = value; }
        }

        #region IConnection Members

        [System.Xml.Serialization.XmlArrayAttribute(Order = 1)]
        [System.Xml.Serialization.XmlArrayItemAttribute("JourneyAttribute", IsNullable = false)]
        public virtual List<JourneyAttribute> JourneyAttributeList
        {
            get
            {
                if ((this.journeyAttributeListField == null))
                {
                    this.journeyAttributeListField = new List<JourneyAttribute>();
                }
                return this.journeyAttributeListField;
            }
            set { this.journeyAttributeListField = value; }
        }

        #endregion
    }

    /// <summary>
    ///   A Walk is an unrouted transition with a duration of max. 15 minutes.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
    public partial class Walk : EntityBase<Walk>, IConnection
    {
        private TimeType durationField;

        private List<JourneyAttribute> journeyAttributeListField;

        [System.Xml.Serialization.XmlElementAttribute(Order = 0)]
        public virtual TimeType Duration
        {
            get
            {
                if ((this.durationField == null))
                {
                    this.durationField = new TimeType();
                }
                return this.durationField;
            }
            set { this.durationField = value; }
        }

        #region IConnection Members

        [System.Xml.Serialization.XmlArrayAttribute(Order = 1)]
        [System.Xml.Serialization.XmlArrayItemAttribute("JourneyAttribute", IsNullable = false)]
        public virtual List<JourneyAttribute> JourneyAttributeList
        {
            get
            {
                if ((this.journeyAttributeListField == null))
                {
                    this.journeyAttributeListField = new List<JourneyAttribute>();
                }
                return this.journeyAttributeListField;
            }
            set { this.journeyAttributeListField = value; }
        }

        #endregion
    }

    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
    public partial class Comment : EntityBase<Comment>
    {
        private string idField;
        private List<Text> textField;

        [System.Xml.Serialization.XmlElementAttribute("Text", Order = 0)]
        public virtual List<Text> Text
        {
            get
            {
                if ((this.textField == null))
                {
                    this.textField = new List<Text>();
                }
                return this.textField;
            }
            set { this.textField = value; }
        }

        [System.Xml.Serialization.XmlAttributeAttribute(DataType = "ID")]
        public virtual string id
        {
            get { return this.idField; }
            set { this.idField = value; }
        }
    }

    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    public enum ConResDir
    {
        /// <remarks />
        O,

        /// <remarks />
        R,
    }

    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    public enum ResCLang
    {
        /// <remarks />
        DE,

        /// <remarks />
        EN,
    }

    /// <summary>
    ///   A named value is used to specify generic extensions. The attribute name specifies the name of the element, the attribute valuetakes the corresponding value.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
    public partial class NamedValue : EntityBase<NamedValue>
    {
        private string nameField;

        private string valueField;

        [System.Xml.Serialization.XmlAttributeAttribute()]
        public virtual string name
        {
            get { return this.nameField; }
            set { this.nameField = value; }
        }

        [System.Xml.Serialization.XmlAttributeAttribute()]
        public virtual string value
        {
            get { return this.valueField; }
            set { this.valueField = value; }
        }
    }

    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
    public partial class RegularServiceText : EntityBase<RegularServiceText>
    {
        private List<Text> textField;

        [System.Xml.Serialization.XmlElementAttribute("Text", Order = 0)]
        public virtual List<Text> Text
        {
            get
            {
                if ((this.textField == null))
                {
                    this.textField = new List<Text>();
                }
                return this.textField;
            }
            set { this.textField = value; }
        }
    }

    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
    public partial class IrregularServiceText : EntityBase<IrregularServiceText>
    {
        private List<Text> textField;

        [System.Xml.Serialization.XmlElementAttribute("Text", Order = 0)]
        public virtual List<Text> Text
        {
            get
            {
                if ((this.textField == null))
                {
                    this.textField = new List<Text>();
                }
                return this.textField;
            }
            set { this.textField = value; }
        }
    }

    /// <summary>
    ///   The Products section shows the product categories, used in the current connection.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
    public partial class Products : EntityBase<Products>
    {
        private List<Product> productField;

        [System.Xml.Serialization.XmlElementAttribute("Product", Order = 0)]
        public virtual List<Product> Product
        {
            get
            {
                if ((this.productField == null))
                {
                    this.productField = new List<Product>();
                }
                return this.productField;
            }
            set { this.productField = value; }
        }
    }

    /// <summary>
    ///   The ConSectionList is a container for the consections that form the connection. A connecton can have a maximum of 12 ConSections. Sections of type Walk and Transfer are counted as a ConSection.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
    public partial class ConSectionList : EntityBase<ConSectionList>
    {
        private List<ConSection> conSectionField;

        [System.Xml.Serialization.XmlElementAttribute("ConSection", Order = 0)]
        public virtual List<ConSection> ConSection
        {
            get
            {
                if ((this.conSectionField == null))
                {
                    this.conSectionField = new List<ConSection>();
                }
                return this.conSectionField;
            }
            set { this.conSectionField = value; }
        }
    }

    /// <summary>
    ///   The element Platform supplies information about the Departure- and Arrivalplatform at a Station. The maximum length of this string is 8 characters.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
    public partial class Platform : EntityBase<Platform>
    {
        private List<Text> textField;

        [System.Xml.Serialization.XmlElementAttribute("Text", Order = 0)]
        public virtual List<Text> Text
        {
            get
            {
                if ((this.textField == null))
                {
                    this.textField = new List<Text>();
                }
                return this.textField;
            }
            set { this.textField = value; }
        }
    }

    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
    public partial class JourneyAttributeList : EntityBase<JourneyAttributeList>
    {
        private List<JourneyAttribute> journeyAttributeField;

        [System.Xml.Serialization.XmlElementAttribute("JourneyAttribute", Order = 0)]
        public virtual List<JourneyAttribute> JourneyAttribute
        {
            get
            {
                if ((this.journeyAttributeField == null))
                {
                    this.journeyAttributeField = new List<JourneyAttribute>();
                }
                return this.journeyAttributeField;
            }
            set { this.journeyAttributeField = value; }
        }
    }

    /// <summary>
    ///   The element PassList contains informations about the passed stops of the current ConSection. It contains a sequence of BasicStop elements
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
    public partial class PassList : EntityBase<PassList>
    {
        private List<BasicStop> basicStopField;

        [System.Xml.Serialization.XmlElementAttribute("BasicStop", Order = 0)]
        public virtual List<BasicStop> BasicStop
        {
            get
            {
                if ((this.basicStopField == null))
                {
                    this.basicStopField = new List<BasicStop>();
                }
                return this.basicStopField;
            }
            set { this.basicStopField = value; }
        }
    }

    /// <summary>
    ///   The CommentList may contain additional informations for the current connection/consection. This feature is not used in the current version of the interface.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
    public partial class CommentList : EntityBase<CommentList>
    {
        private List<Comment> commentField;

        [System.Xml.Serialization.XmlElementAttribute("Comment", Order = 0)]
        public virtual List<Comment> Comment
        {
            get
            {
                if ((this.commentField == null))
                {
                    this.commentField = new List<Comment>();
                }
                return this.commentField;
            }
            set { this.commentField = value; }
        }
    }

    /// <summary>
    ///   The TrainSearchRes contains the station list, which are passed on the journey.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
    public partial class TrainSearchRes : EntityBase<TrainSearchRes>
    {
        private List<Err> errField;

        private List<BasicStop> itemsField;

        private string nameField;

        [System.Xml.Serialization.XmlElementAttribute("Err", Order = 0)]
        public virtual List<Err> Err
        {
            get
            {
                if ((this.errField == null))
                {
                    this.errField = new List<Err>();
                }
                return this.errField;
            }
            set { this.errField = value; }
        }

        [System.Xml.Serialization.XmlElementAttribute("BasicStop", Order = 1)]
        public virtual List<BasicStop> Items
        {
            get
            {
                if ((this.itemsField == null))
                {
                    this.itemsField = new List<BasicStop>();
                }
                return this.itemsField;
            }
            set { this.itemsField = value; }
        }

        [System.Xml.Serialization.XmlAttributeAttribute()]
        public virtual string name
        {
            get { return this.nameField; }
            set { this.nameField = value; }
        }
    }
}